#pragma once

#include "Plugin.h"
#import "ofxOsc.h"
#import <netinet/in.h>
#import <sys/socket.h>

//#define USE_QTKIT 
@class QTMovie;
#define NUMVIDEOS 3

@interface VideoPlayer : ofPlugin {
	QTMovie     		*movie[NUMVIDEOS];
	QTVisualContextRef	textureContext[NUMVIDEOS];
	CVOpenGLTextureRef  currentFrame[NUMVIDEOS];
	
	int lastFramesVideo;
	
	NSString * keys[4][2];
	
	float whiteFlash;
/*	float fadeDown;
	int fadeDirection;
*/	
	ofSerial * arduino;
	
	ofxOscSender * oscSender[4];
	ofxOscSender * oscDirectSender[4];
	ofxOscReceiver * oscReceiver;
	
	NSDate * latencyTimer;
	NSDate * timecodeSetterTimer;
	
	bool arduinoConnected;
	
	IBOutlet NSTextField * arduinoConnectionText;
	IBOutlet NSImageView * arduinoConnectionImage;
	
	//Network
    NSNetService *netService;
    NSMutableArray *services;
	NSNetServiceBrowser *browser;
    NSNetService *connectedService;
	
	float timecodeDifference;
	
	BOOL forceDrawNextFrame;
	

}
/*
@property (readwrite, retain) NSNetServiceBrowser *browser;
@property (readwrite, retain) NSMutableArray *services;
//@property (readwrite, assign) BOOL isConnected;
@property (readwrite, retain) NSNetService *connectedService;

 
-(IBAction) load:(id)sender;
*/

-(IBAction) restart:(id)sender;

@end
